package com.linln.modules.message.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.linln.common.utils.StatusUtil;
import com.linln.modules.member.domain.MemberInfo;
import lombok.Data;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name="message_refund")
@EntityListeners(AuditingEntityListener.class)
@Where(clause = StatusUtil.NOT_DELETE)
public class MessageRefund  implements Serializable {

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;

    @NotFound(action= NotFoundAction.IGNORE)
    @JoinColumn(name="message_id")
    private Long messageId;

    @NotFound(action= NotFoundAction.IGNORE)
    @JoinColumn(name="member_id")
    private Long memberId;

    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;
    // 更新时间
    @LastModifiedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateDate;

    private String content;
    // 0 未读  1 已读
    private Integer status;

    private Long adminId;
    //1代表评论提醒 2过期提醒 6、反馈提醒
    private Integer type;
}
